<template>
    <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
            <el-button
                    type="primary"
                    icon="el-icon-plus"
                    size="mini"
                    @click="handleAdd"
            >新增
            </el-button>
        </el-col>
        <el-col :span="1.5">
            <el-button
                    type="success"
                    icon="el-icon-edit"
                    size="mini"
                    :disabled="single"
                    @click="handleUpdate"
            >修改
            </el-button>
        </el-col>
        <el-col :span="1.5">
            <el-button
                    type="danger"
                    icon="el-icon-delete"
                    size="mini"
                    :disabled="multiple"
                    @click="handleDelete"
            >删除
            </el-button>
        </el-col>
        <el-col :span="1.5">
            <el-button
                    type="info"
                    icon="el-icon-upload2"
                    size="mini"
                    @click="handleImport"
            >导入
            </el-button>
        </el-col>
        <el-col :span="1.5">
            <el-button
                    type="warning"
                    icon="el-icon-download"
                    size="mini"
                    @click="handleExport"
            >导出
            </el-button>
        </el-col>
    </el-row>
</template>

<script>
    export default {
        name: "BtnGroup",
        props: {
            single: {
                type: Boolean,
                default: () => false
            },
            multiple: {
                type: Boolean,
                default: () => false
            }
        },
        methods: {
            /** 新增按钮操作 */
            handleAdd() {
                this.$emit('add')
            },
            /** 修改按钮操作 */
            handleUpdate(row) {
                this.$emit('update', row)
            },
            /** 删除按钮操作 */
            handleDelete(row) {
                this.$emit('delete', row)
            },
            /** 导入按钮操作 */
            handleImport(row) {
                this.$emit('import', row)
            },
            /** 导出按钮操作 */
            handleExport(row) {
                this.$emit('export')
            },
        }
    }
</script>

<style scoped>

</style>